Test Series - java script

Test Number 93/92

Q: Which of the following is not a JavaScript framework?
A. Rico
B. Prototype
C. Joco
D. DoJo
Solution: Dojo Toolkit is an open source modular JavaScript library (or more specifically JavaScript toolkit) designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. Rico was an open-source JavaScript library for developing rich internet applications with Ajax.
Q: What is the purpose of the Math method toSource()?
A. Returns the string “Math”
B. Sends the source to the Math Library
C. Returns the value of the object
D. Returns an integer value
Solution: The method Math.toSource() returns the string “Math”. But this method does not work with many browsers like IE. The toSource() method returns a string representing the source code of the object.
Q: What will be the output of the following JavaScript code?
var o = new F();
o.constructor === F
A. false
B. true
C. 0
D. 1
Solution: ’===’ sign is used for comparing the type of values. The result is true if the constructor property specifies the class.
Q: How many static methods does a Date object have?
A. 3
B. 5
C. 4
D. 2
Solution: Date objects are created with the new Date() constructor. The Date object defines two static methods namely Date.parse() and Date.UTC().
Q: Which of the following are static methods in JavaScript?
A. Date.parse()
B. Date.UTC()
C. Both Date.parse() and Date.UTC()
D. Date.clear()
Solution: Date objects are created with the new Date() constructor. Date.parse() parses a string representation of a date and time and returns the internal millisecond representation of that date. Date.UTC() Returns the millisecond representation of the specified UTC date and time.
Q: What will be the work of the getAvg in the following JavaScript function?




Q: Which of the following is not an object?
A. Element
B. Location
C. Position
D. Window
Solution: The window object represents an open window in a browser. There is no object called Position.
Q: What is the code snippet to change the class and let the stylesheet specify the details?
A. timestamp.className = “highlight”;
B. timestamp.className = “change”;
C. timestamp.className = “specify”;
D. timestamp.className = “move”;
Solution: “typename” is a keyword in the C++ programming language used when writing templates. The above code snippet changes the class and lets the stylesheet specify the details.

You Have Score    /10